package cn.net.dpi.shp.model.entity;

import cn.net.dpi.shp.handler.LineStringTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.locationtech.jts.geom.LineString;

import java.io.Serializable;

/**
 * @TableName bxf_obj_geos
 */
@TableName(value = "bxf_obj_geos")
@Data
public class BxfObjGeos implements Serializable {
    /**
     *
     */
    @TableId
    private Integer fid;

    /**
     *
     */
    @TableField(typeHandler = LineStringTypeHandler.class)
    private LineString theGeom;

    /**
     *
     */
    private Long id;

    /**
     *
     */
    private Long type;

    /**
     *
     */
    private Long subtype;

    /**
     *
     */
    private Double x;

    /**
     *
     */
    private Double y;

    /**
     *
     */
    private Double height;

    /**
     *
     */
    private Double width;

    /**
     *
     */
    private Double length;

    /**
     *
     */
    private Double heading;

    /**
     *
     */
    private Long hasgeometr;

    private Long fileId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BxfObjGeos other = (BxfObjGeos) that;
        return (this.getFid() == null ? other.getFid() == null : this.getFid().equals(other.getFid()))
                && (this.getTheGeom() == null ? other.getTheGeom() == null : this.getTheGeom().equals(other.getTheGeom()))
                && (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
                && (this.getSubtype() == null ? other.getSubtype() == null : this.getSubtype().equals(other.getSubtype()))
                && (this.getX() == null ? other.getX() == null : this.getX().equals(other.getX()))
                && (this.getY() == null ? other.getY() == null : this.getY().equals(other.getY()))
                && (this.getHeight() == null ? other.getHeight() == null : this.getHeight().equals(other.getHeight()))
                && (this.getWidth() == null ? other.getWidth() == null : this.getWidth().equals(other.getWidth()))
                && (this.getLength() == null ? other.getLength() == null : this.getLength().equals(other.getLength()))
                && (this.getHeading() == null ? other.getHeading() == null : this.getHeading().equals(other.getHeading()))
                && (this.getHasgeometr() == null ? other.getHasgeometr() == null : this.getHasgeometr().equals(other.getHasgeometr()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFid() == null) ? 0 : getFid().hashCode());
        result = prime * result + ((getTheGeom() == null) ? 0 : getTheGeom().hashCode());
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getSubtype() == null) ? 0 : getSubtype().hashCode());
        result = prime * result + ((getX() == null) ? 0 : getX().hashCode());
        result = prime * result + ((getY() == null) ? 0 : getY().hashCode());
        result = prime * result + ((getHeight() == null) ? 0 : getHeight().hashCode());
        result = prime * result + ((getWidth() == null) ? 0 : getWidth().hashCode());
        result = prime * result + ((getLength() == null) ? 0 : getLength().hashCode());
        result = prime * result + ((getHeading() == null) ? 0 : getHeading().hashCode());
        result = prime * result + ((getHasgeometr() == null) ? 0 : getHasgeometr().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", fid=").append(fid);
        sb.append(", theGeom=").append(theGeom);
        sb.append(", id=").append(id);
        sb.append(", type=").append(type);
        sb.append(", subtype=").append(subtype);
        sb.append(", x=").append(x);
        sb.append(", y=").append(y);
        sb.append(", height=").append(height);
        sb.append(", width=").append(width);
        sb.append(", length=").append(length);
        sb.append(", heading=").append(heading);
        sb.append(", hasgeometr=").append(hasgeometr);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}